import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '品类',
    align:"center",
    dataIndex: 'category'
   },
   {
    title: '外箱条码',
    align:"center",
    dataIndex: 'outerBoxBarcode'
   },
   {
    title: '中盒条码',
    align:"center",
    dataIndex: 'middleBoxBarcode'
   },
   {
    title: '商品条码',
    align:"center",
    dataIndex: 'productBarcode'
   },
   {
    title: '品名',
    align:"center",
    dataIndex: 'productName'
   },
   {
    title: '单位',
    align:"center",
    dataIndex: 'unit'
   },
   {
    title: '商品图片',
    align:"center",
    dataIndex: 'productImage'
   },
   {
    title: '箱规',
    align:"center",
    dataIndex: 'boxSpec'
   },
   {
    title: '有效期',
    align:"center",
    dataIndex: 'expirationDate'
   },
   {
    title: '产地',
    align:"center",
    dataIndex: 'origin'
   },
   {
    title: '出厂价',
    align:"center",
    dataIndex: 'factoryPrice'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "外箱条码",
      field: 'outerBoxBarcode',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "商品条码",
      field: 'productBarcode',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '品类',
    field: 'category',
    component: 'Input',
  },
  {
    label: '外箱条码',
    field: 'outerBoxBarcode',
    component: 'Input',
  },
  {
    label: '中盒条码',
    field: 'middleBoxBarcode',
    component: 'Input',
  },
  {
    label: '商品条码',
    field: 'productBarcode',
    component: 'Input',
  },
  {
    label: '品名',
    field: 'productName',
    component: 'Input',
  },
  {
    label: '单位',
    field: 'unit',
    component: 'Input',
  },
  {
    label: '商品图片',
    field: 'productImage',
    component: 'Input',
  },
  {
    label: '箱规',
    field: 'boxSpec',
    component: 'Input',
  },
  {
    label: '有效期',
    field: 'expirationDate',
    component: 'Input',
  },
  {
    label: '产地',
    field: 'origin',
    component: 'Input',
  },
  {
    label: '出厂价',
    field: 'factoryPrice',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  category: {title: '品类',order: 0,view: 'text', type: 'string',},
  outerBoxBarcode: {title: '外箱条码',order: 1,view: 'text', type: 'string',},
  middleBoxBarcode: {title: '中盒条码',order: 2,view: 'text', type: 'string',},
  productBarcode: {title: '商品条码',order: 3,view: 'text', type: 'string',},
  productName: {title: '品名',order: 4,view: 'text', type: 'string',},
  unit: {title: '单位',order: 5,view: 'text', type: 'string',},
  productImage: {title: '商品图片',order: 6,view: 'text', type: 'string',},
  boxSpec: {title: '箱规',order: 7,view: 'text', type: 'string',},
  expirationDate: {title: '有效期',order: 8,view: 'text', type: 'string',},
  origin: {title: '产地',order: 9,view: 'text', type: 'string',},
  factoryPrice: {title: '出厂价',order: 10,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}